package com.woniu40.petai_manager.service;

import com.woniu40.petai_manager.entity.Brand;
import com.woniu40.petai_manager.entity.ProductType;
import com.woniu40.petai_manager.mapper.ProductTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductTypeService {

    @Autowired
    ProductTypeMapper productTypeMapper;

    public List<ProductType> findAllProductType(){
        return productTypeMapper.selectAll();
    }

    public int addPro(ProductType productType) {
        return productTypeMapper.insert(productType);
    }

    public ProductType findById(Integer productTypeId) {
        return productTypeMapper.selectById(productTypeId);
    }

    public int modifyPro(ProductType productType) {
        return productTypeMapper.update(productType);
    }

    public int removeByIds(List<Integer> idList) {
        return productTypeMapper.deleteByIds(idList);
    }

    public int removePro(Integer id) {
        return productTypeMapper.deleteById(id);
    }
}
